<template>
    <div>
        BComponent
        <p v-fontColor="{ color:'green' }">哈哈</p>
        <p> {{ 200 | rmb | author }} </p>
    </div>
</template>
<script>
export default {
    name:"BComponent",
    directives:{
        fontColor:{
            inserted:function(el,binding){
                el.style.color = binding.value.color;
            }
        }
    },
    filters:{
        rmb:function(value){
            if(value>0){
                return "￥"+value +".00"
            }
        }
    }
}
</script>
<style scoped>

</style>
